home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Complet / emovix / eMovix-0.9.0pre1_Setup.exe / {app} / src / movix / rc.movix < prev    next >
Encoding:
Text File  |  2003-12-18  |  5.7 KB  |  172 lines

  1. #!/bin/sh
  2.  
  3. # initialize bootsplash stuff...
  4. splash=silent
  5. bs=yes
  6. box() { true; } # ignore box descriptions in the config file
  7. if [ -f /etc/bootsplash/themes/current/config/bootsplash-`fbresolution`.cfg ] && [ $splash = silent ] ;  then
  8.   . /etc/bootsplash/themes/current/config/bootsplash-`fbresolution`.cfg
  9. else
  10.   bs=no
  11. fi    
  12.             
  13. ### first splash screen msg
  14. if [ $bs = yes ] ; then
  15.   /usr/sbin/progress $text_x $text_y $text_box_dx $text_box_dy 0
  16.   /usr/sbin/fbtruetype -x $text_x -y $text_y -t $text_color -s $text_size "Copying system files..."
  17.   echo "show 40000" > /proc/splash
  18. fi
  19.  
  20. #####################################
  21. # Copying in RAM all movix files...
  22. #################
  23. cp -a /cdrom/movix/profile            /etc/
  24. chmod a+x /etc/profile
  25. cp -a /cdrom/movix/mixer.pl           /usr/local/bin/
  26. chmod a+x /usr/local/bin/mixer.pl
  27. cp -a /cdrom/movix/rc.lirc            /etc/rc.d
  28. chmod a+x /etc/rc.d/rc.lirc
  29. cp -a /cdrom/movix/setHardware.pl     /usr/local/bin/
  30. chmod a+x /usr/local/bin/setHardware.pl
  31. cp -a /cdrom/movix/movix.pl           /usr/local/bin/
  32. chmod a+x /usr/local/bin/movix.pl
  33. ln -s /usr/local/bin/movix.pl         /usr/bin/list
  34. cp -a /cdrom/movix/bugReport.sh       /usr/local/bin/
  35. chmod a+x /usr/local/bin/bugReport.sh
  36. cp -a /cdrom/movix/isapnpmodules.sh   /sbin
  37. chmod a+x /sbin/isapnpmodules.sh
  38. cp -a /cdrom/movix/showisapnpmodules.sh   /sbin
  39. chmod a+x /sbin/showisapnpmodules.sh
  40. cp -a /cdrom/movix/movixrc            /root/.movixrc
  41. #mkdir /root/.mplayer/
  42. cp -a /cdrom/movix/config             /root/.mplayer/
  43. cp -a /cdrom/movix/*conf              /root/.mplayer/
  44. cp -a /cdrom/movix/help.txt           /root/.mplayer/
  45. cp -a /cdrom/movix/manpage.txt        /root/.mplayer/
  46. cp -a /cdrom/movix/remotes.data       /tmp/
  47. ln -s /tmp/remotes.data               /root/
  48. cp -a /cdrom/movix/lirc*              /tmp/
  49. ln -s /tmp/lirc*                      /root/
  50. mkdir -p /tmp/codecs/
  51. ln -s /tmp/codecs/ /usr/local/win32
  52.  
  53. if [ -e /cdrom/mplayer/font ] ; then 
  54.     cp -a /cdrom/mplayer/font/ /tmp/
  55.     ln -s /tmp/font/  /root/.mplayer/
  56. else 
  57.     cp -a /cdrom/mplayer/subfont.ttf /tmp/
  58.     ln -s /tmp/subfont.ttf /root/.mplayer/
  59. fi
  60.  
  61. # Create a directory for auto-generated subfiles
  62. mkdir -p /tmp/sub
  63. ln -s /tmp/sub /root/.mplayer/sub
  64.  
  65. if [ $bs = yes ] ; then
  66.   /usr/sbin/progress $text_x $text_y $text_box_dx $text_box_dy 0
  67.   /usr/sbin/fbtruetype -x $text_x -y $text_y -t $text_color -s $text_size "Setting up additional modules..."
  68.   echo "show 50000" > /proc/splash
  69. fi
  70.  
  71. # copy and load the international keyboard layout
  72. mkdir -p /usr/local/share
  73. cp -a /cdrom/movix/shellkey.map /usr/local/share
  74. loadkmap < /usr/local/share/shellkey.map
  75.  
  76. if [ -e /cdrom/isolinux/help.txt ]; then
  77.     cp /cdrom/isolinux/help.txt /etc
  78. fi
  79.  
  80. if [ -e /cdrom/movix/libdvdcss.so ] ; then
  81.     cp -a /cdrom/movix/libdvdcss.so   /lib/libdvdcss.so.2
  82. fi
  83. if [ -e /cdrom/movix/libdvdcss-1.2.6-1.i386.rpm ] ; then
  84.     rpm2cpio /cdrom/movix/libdvdcss-1.2.6-1.i386.rpm > /tmp/libdvdcss-1.2.6-1.i386.cpio
  85.     cd /tmp
  86.     cpio -i -u -d -F libdvdcss-1.2.6-1.i386.cpio
  87.     ln -s /tmp/usr/lib/libdvdcss.so.2*     /lib
  88. fi    
  89.  
  90. # Background video
  91. if [ -e /cdrom/movix/movix.music.avi ]; then
  92.     cp /cdrom/movix/movix.music.avi /tmp/movix.music.avi
  93. fi
  94.  
  95. ### Loading the QuickTime DLLs
  96. if [ `find /cdrom/mplayer/codecs/ -name "qt*"` ] ; then
  97.     echo "Loading QuickTime DLLs in RAM..."
  98.     for i in `ls /cdrom/mplayer/codecs/qt*` ; do cd /tmp/ && bunzip2 -c $i | tar -x ; done;
  99.     ln -s /tmp/qt*/* /tmp/codecs/
  100. fi
  101.  
  102. ### Loading the RealPlayer DLLs
  103. if [ `find /cdrom/mplayer/codecs/ -name "rp*"` ] ; then
  104.     echo "Loading RealPlayer DLLs in RAM..."
  105.     for i in `ls /cdrom/mplayer/codecs/rp*` ; do cd /tmp/ && bunzip2 -c $i | tar -x ; done;
  106.     ln -s /tmp/rp*/* /tmp/codecs/
  107. fi
  108.  
  109. ### Loading the Win32 DLLs
  110. if [ `find /cdrom/mplayer/codecs/ -name "win32*"` ] ; then
  111.     echo "Loading Win32 DLLs in RAM..."
  112.     for i in `ls /cdrom/mplayer/codecs/win32*` ; do cd /tmp && bunzip2 -c $i | tar -x ; done;
  113.     ln -s /tmp/win32*/* /tmp/codecs/
  114. fi
  115.  
  116. ### Loading the Xanim DLLs
  117. if [ `find /cdrom/mplayer/codecs/ -name "xanim*"` ] ; then
  118.     echo "Loading Xanim DLLs in RAM..."
  119.     for i in `ls /cdrom/mplayer/codecs/xanim*` ; do cd /tmp && bunzip2 -c $i | tar -x ; done;
  120.     ln -s /tmp/xanim*/* /tmp/codecs/
  121. fi
  122.  
  123. if [ $bs = yes ] ; then
  124.   /usr/sbin/progress $text_x $text_y $text_box_dx $text_box_dy 0
  125.   /usr/sbin/fbtruetype -x $text_x -y $text_y -t $text_color -s $text_size "Libraries loaded"
  126.   echo "show 58000" > /proc/splash
  127. fi
  128.  
  129. ### It's easier to do this than including ldconfig in MoviX
  130. ln -s /usr/local/mplayer/lib/lib* /usr/lib
  131. ### Let's use aliases for the movix script to let play dvd, vcd, mp3 CD & audio cd
  132. ln -s /usr/bin/movix /usr/bin/dvd
  133. ln -s /usr/bin/movix /usr/bin/vcd
  134. ln -s /usr/bin/movix /usr/bin/acd
  135. ln -s /usr/bin/movix /usr/bin/mcd
  136.  
  137. ##############################################
  138. ###  Load a few modules
  139. ########################
  140. /usr/local/bin/setHardware.pl
  141.  
  142. ### Start the lirc daemon if a remote is found
  143. /etc/rc.d/rc.lirc
  144.  
  145. ##############################################
  146. #     Detect & load ISA modules              #
  147. ##############################################
  148.     
  149. get_isapnp_modules () {
  150.    while read IGNORE ID IGNORE
  151.        do
  152.          DEVICE="0x"`echo $ID | cut -b6-7``echo $ID | cut -b4-5`
  153.          cat /lib/modules/`uname -r`/modules.isapnpmap | grep "^[^ ][^ ]*  *[^ ][^ ]*  *$DEVICE " | cut -f 1 -d " "
  154.        done
  155. }
  156.  
  157. for MODULE in `get_isapnp_modules < /proc/bus/isapnp/devices | sort -u`
  158. do 
  159.   echo Loading module $MODULE
  160.   modprobe -s $MODULE
  161. done
  162.  
  163. if [ $bs = yes ] ; then
  164.   /usr/sbin/progress $text_x $text_y $text_box_dx $text_box_dy 0
  165.   /usr/sbin/fbtruetype -x $text_x -y $text_y -t $text_color -s $text_size "Setup ready, starting eMoviX playback..."
  166.   echo "show 65500" > /proc/splash
  167. fi
  168.  
  169. umount /cdrom
  170. rm -rf /cdrom
  171. /bin/setterm -blank 0
  172.